﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using IAH.Vote.Common.DI;
using IAH.Vote.Common.Logger;
using Microsoft.Practices.Unity;

namespace IAM.Vote.Web
{
    public class Bootstrapper
    {
        public Bootstrapper(IUnityContainer unityContainer = null)
        {
            var container = (unityContainer != null) ? unityContainer : GetUnityContainer();
            DependencyResolver.SetResolver(new UnityDependencyResolver(container));
        }

        private IUnityContainer GetUnityContainer()
        {
            IUnityContainer container = new UnityContainer()
                .RegisterType<ILogger, Logger>();

            return container;
        }
    }
}